package com.poizon.infrastructure.center.config.starter.nacos;

import com.alibaba.nacos.api.config.listener.Listener;
import com.poizon.infrastructure.center.config.core.event.listener.AbstractChangeListener;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Executor;

@Slf4j
@AllArgsConstructor
public class NacosChangeListener implements Listener {
    private AbstractChangeListener abstractChangeListener;

    @Override
    public Executor getExecutor() {
        return abstractChangeListener.getExecutor();
    }

    @Override
    public void receiveConfigInfo(String configInfo) {
        log.info("[配置中心监听器] 监听到nacos配置变更");
        abstractChangeListener.receiveConfigInfo(configInfo);
    }
}
